home *** CD-ROM | disk | FTP | other *** search
/ The Sunday Times: Parent Power / The Sunday Times - Parent Power.iso / pc / engine / navigation.swf / scripts / frame_1 / DoAction.as
Encoding:
Text File  |  2005-11-04  |  2.8 KB  |  98 lines

  1. _g = _global;
  2. var navArray = new Array("home","league_tables","schools_of_year","search","shortlist","links");
  3. var i = 0;
  4. while(i < navArray.length)
  5. {
  6.    var mc = eval(navArray[i]);
  7.    mc.onRollOver = function()
  8.    {
  9.       this.gotoAndStop("over");
  10.    };
  11.    mc.onRollOut = mc.onReleaseOutside = function()
  12.    {
  13.       this.gotoAndStop(1);
  14.    };
  15.    i++;
  16. }
  17. home.onRelease = function()
  18. {
  19.    var _loc1_ = _parent;
  20.    if(_g.gNavActive != "home")
  21.    {
  22.       _loc1_.content.removeMovieClip();
  23.       _loc1_.nav_activate("home",this);
  24.       _loc1_.movie_load("home.swf");
  25.    }
  26. };
  27. league_tables.onRelease = function()
  28. {
  29.    var _loc1_ = _parent;
  30.    _loc1_.searchMovieFunction = "league";
  31.    if((_g.gNavActive != "league_tables" || _g.gNavActive == "league_tables" && _loc1_.content._currentframe < 142) && _g.gNavActive != "search")
  32.    {
  33.       _loc1_.content.school_info.removeMovieClip();
  34.       _loc1_.content.search.removeMovieClip();
  35.       _loc1_.content.gotoAndPlay(1);
  36.       _loc1_.content.removeMovieClip();
  37.       _loc1_.movie_load("search.swf");
  38.       _loc1_.nav_activate("league_tables",this);
  39.    }
  40.    else if(_g.gNavActive != "league_tables")
  41.    {
  42.       _loc1_.content.gotoAndPlay(1);
  43.       _loc1_.nav_activate("league_tables",this);
  44.    }
  45. };
  46. schools_of_year.onRelease = function()
  47. {
  48.    var _loc1_ = _parent;
  49.    _loc1_.content.removeMovieClip();
  50.    _loc1_.nav_activate("schools_of_year",this);
  51.    _loc1_.movie_load("schools_of_year.swf");
  52. };
  53. search.onRelease = function()
  54. {
  55.    var _loc1_ = _parent;
  56.    if(_g.gNavActive != "search" || _g.gNavActive == "search" & _loc1_.content._currentframe > 40)
  57.    {
  58.       _loc1_.searchMovieFunction = "search";
  59.       _loc1_.nav_activate("search",this);
  60.       _loc1_.content.school_info.removeMovieClip();
  61.       _loc1_.content.search.removeMovieClip();
  62.       _loc1_.content.gotoAndPlay(1);
  63.       _loc1_.movie_load("search.swf");
  64.    }
  65. };
  66. shortlist.onRelease = function()
  67. {
  68.    var _loc1_ = _parent;
  69.    if(_g.gNavActive != "shortlist")
  70.    {
  71.       if(_g.gShortlist.schools.length >= 1)
  72.       {
  73.          _loc1_.nav_activate("shortlist",this);
  74.          _loc1_.content.school_info.removeMovieClip();
  75.          _loc1_.content.gotoAndPlay(1);
  76.          _loc1_.movie_load("search.swf");
  77.       }
  78.       else
  79.       {
  80.          var _loc2_ = new Object();
  81.          _loc2_.title = "You have no schools within your shortlist";
  82.          _loc2_.content = "To shortlist a school, click the schoolΓÇÖs save button on the search results page.";
  83.          _loc1_.help_view(_loc2_,clip);
  84.       }
  85.    }
  86. };
  87. links.onRelease = function()
  88. {
  89.    var _loc1_ = _parent;
  90.    if(_g.gNavActive != "shortlist")
  91.    {
  92.       _loc1_.content.removeMovieClip();
  93.       _loc1_.nav_activate("links",this);
  94.       _loc1_.movie_load("links.swf");
  95.    }
  96. };
  97. _parent.nav_activate("home");
  98.